load ResetTabs,RefLinks,AttachData,SourceButtons,ListBlock,References

if printing is false
  #fraction=375/#rightMargin$
  show CONC 1-#fraction
  if #rightMargin$<375
    ifStr #posNotes="right"
      DisplayWidth 375
    else ifStr #posNotes="left"
      DisplayWidth 375
    endif
  endif
endif

! -------------- Start Template -----------------
GoSub ResetTabs,0
DropTypes INDI,FAM

! --------- Cross referecnes -----------
#oldWidth=#rightMargin$
DisplayWidth #oldWidth+#rightSkip+1
newline -#topMargin$-1
hskip -#leftSkip-1
cell GroupBox
  border line
  titleposition none
  cellbackground "Record Header Box Background"
  width -1

  newline -6
  cell label,local("Notes on")&":"
  sizetofit
  set tabwidth -1 alignment right

  gosub RefLinks,"",local("All Notated Records")

  #leftSkip=#leftSkip$
  #lineSkip=#lineSkip$
EndGroup

DisplayWidth #oldWidth

! --------- The notes -----------
if printing
  cell ExpressionField,@CONC
  set Width -1 border none
  set minHeight 15
  sizetofit 3
  show CONC
endif

! --------- SOURs -----------
#numSOURs=@count.SOUR
!Gosub TagBlock,"SOUR","Sources"
gosub References,""

! --------- Attach links
newline
cell GroupBox,local("Attach Source")
  width -1
  newline -#lineSkip-3
  #lineSkip=0
  Show SOUR
  gosub AttachData
  GoSub SourceButtons,"true",#numSOURs
EndGroup
#lineSkip=#lineSkip$

! only legal stuff left is REFN, RIN, and CHAN
! and custom _DIST
ClearTabs
gosub ResetTabs,50
cell GroupBox,local("Additional Data")
  width -1
  Show _DIST "label"
  ShowAll CHAN
  ShowAll all
EndGroup

optionalTag RIN,local(RIN)
optionalTag REFN,local(REFN)
optionalTag,REFN,local("Keyword(s)"), ,"TYPE Keyword(s)"
